<!-- 导入地图 -->
<template>
  <!-- 展示地图 -->
  <view class="map">
    <!-- <busmap :lineCode="lineCode" ></busmap> -->
    <baidu-map
      style="width: 750rpx; height:700rpx;" :center="centerPosition" :zoom="15" :scroll-wheel-zoom="true"
      @ready="loadedMap" @click="mapDot">
      <bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT"/>
      <!-- <bm-marker :position="startposition"  animation="BMAP_ANIMATION_BOUNCE"> -->

      <!-- <bm-point-collection
        :points="polylinePaths" shape=" BMAP_POINT_SHAPE_WATERDROP" color="blue"
        size="BMAP_POINT_SIZE_BIG"/> -->
      <bm-polyline :path="polylinePaths" stroke-color="blue" :stroke-opacity="0.5" :stroke-weight="4"/>
      <!-- </bm-marker> -->
      <!-- <bm-marker :position="{lng:dot.lng, lat:dot.lat}" :dragging="true" animation="BMAP_ANIMATION_BOUNCE" :icon="{url, size: {width: 50, height: 50}}">
        <bm-label content="我爱北京天安门" :label-style="{color: 'red', fontSize : '24px'}" :offset="{width: -35, height: 30}"/>
      </bm-marker> -->
    </baidu-map>
  </view>

</template>

<script>

export default {
  props: {
    url: {
      type: String,
      default: '../../static/logo.png'
    },
    polylinePath: {
      type: Array,
      default: () => [
        {
          lng: 116.404,
          lat: 39.915
        },
        {
          lng: 116.405,
          lat: 39.920
        }
      ]
    },
    centerPosition: {
      type: Object,
      default: () => ({ lng: 116.404,
        lat: 39.915 })
    }
  },
  data() {
    return {
      startposition: {
        lng: 116.404,
        lat: 39.915
      },
      // lng: this.lng,
      // lat: this.lat,
      polylinePaths: [],

      lineCode: '',
      items: ['地图'],
      buttonIndex: 0,
      scale: 16 // 地图缩放比例
    }
  },
  mounted() {
    this.polylinePaths = this.polylinePath
  },
  methods: {

  }
}

</script>

<style lang="scss" scoped>

</style>

